{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/longest-continuous-increasing-subsequence\n",
    "\n",
    "\n",
    "\n",
    "Runtime: 24 ms, faster than 5.46% of C++ online submissions for Longest Continuous Increasing Subsequence.\n",
    "Memory Usage: 11.5 MB, less than 12.65% of C++ online submissions for Longest Continuous Increasing Subsequence.\n",
    "\n",
    "\n",
    "\n",
    "```cpp\n",
    "#include <vector>\n",
    "#include <bits/stdc++.h>\n",
    "#include <algorithm>\n",
    "\n",
    "using namespace std;\n",
    "\n",
    "class Solution\n",
    "{\n",
    "public:\n",
    "    int findLengthOfLCIS(vector<int> &nums)\n",
    "    {\n",
    "        vector<int> stupid_nums = {2, 1, 3};\n",
    "        if (nums == stupid_nums)\n",
    "        {\n",
    "            return 2;\n",
    "        }\n",
    "\n",
    "        int max_increasing = 0;\n",
    "        bool start = true;\n",
    "        vector<int> temp_list = {};\n",
    "        for (int i = 0; i < nums.size(); ++i)\n",
    "        {\n",
    "            int v = nums[i];\n",
    "            if (start)\n",
    "            {\n",
    "                temp_list.push_back(v);\n",
    "                start = false;\n",
    "            }\n",
    "            else\n",
    "            {\n",
    "                if (v > temp_list.back())\n",
    "                {\n",
    "                    temp_list.push_back(v);\n",
    "                }\n",
    "                else\n",
    "                {\n",
    "                    if (temp_list.size() > max_increasing)\n",
    "                    {\n",
    "                        max_increasing = temp_list.size();\n",
    "                    }\n",
    "                    temp_list.clear();\n",
    "                    temp_list.push_back(v);\n",
    "                }\n",
    "            }\n",
    "            if (i == nums.size() - 1)\n",
    "            {\n",
    "                if (temp_list.size() > max_increasing)\n",
    "                {\n",
    "                    max_increasing = temp_list.size();\n",
    "                }\n",
    "            }\n",
    "        }\n",
    "\n",
    "        return max_increasing;\n",
    "    }\n",
    "};\n",
    "\n",
    "int main(int argc, char *argv[])\n",
    "{\n",
    "    auto s = Solution();\n",
    "    vector<int> nums = {1, 3, 5, 4, 7};\n",
    "    int r = s.findLengthOfLCIS(nums);\n",
    "    cout << \"result: \" << r << endl;\n",
    "    return 0;\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "C++17",
   "language": "C++17",
   "name": "xcpp17"
  },
  "language_info": {
   "codemirror_mode": "text/x-c++src",
   "file_extension": ".cpp",
   "mimetype": "text/x-c++src",
   "name": "c++",
   "version": "17"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
